package org.infinity;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.regex.Matcher;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class FileMonitor {
    private static final Log log = LogFactory.getLog(FileMonitor.class);

    /**
     * @param args
     */
    public static void main(String[] args) {
        // System.out.println(Matcher.quoteReplacement(new File(fileName).getAbsolutePath()));
        // if (true)return;
        // Properties props = new Properties();
        // props.l
        // System.out.println(Util.getMessage("test"));
        // HashMap testObj = new HashMap();
        // testObj.put("te", "asdasd");
        // Util.saveObject("testfile", testObj);
        // HashMap testObj = (HashMap) Util.loadObject("testfile");
        // System.out.println(testObj.get("te"));
        // System.out.println(Conig.getInstance().getDistPath());
        // System.out.println(Conig.getInstance().getFrequency());
        // File file = new File("D:\\video\\Feist - 1234.divx");
        // System.out.println(file.getAbsolutePath());
        // Util.showMessage("info.001","111.file",new Date(),new Date());
        // FileMap.getInstance();

        if (false) {

             File s = Config.getInstance().getDestPath();
             
             for (File f : s.getParentFile().listFiles()) {
                 System.out.println(f.getAbsolutePath());
            }
             // log.debug(Matcher.quoteReplacement(s));
//             String path = Util.encode(s);
//             path = Util.decode(path);

            // log.debug(path);

            // log.debug("testdebug");
            // log.info("testinfo");
            // Config.getInstance().setDestPath(new File("d:\\temp"));

            // Properties prop = new Properties();
            // try {
            // // prop.load(new FileInputStream("asd"));
            // prop.put("key", "val\\ue");
            // prop.store(new FileOutputStream("asd"), "File monitor config");
            // } catch (FileNotFoundException e) {
            // e.printStackTrace();
            // } catch (IOException e) {
            // e.printStackTrace();
            // }

            return;
        }
        Monitor.StartMonitor();
    }

}
